let changeColor = document.getElementById('changeColor');

function setColor() {
    chrome.storage.sync.get('color', function (data) {
        changeColor.style.backgroundColor = data.color;
        changeColor.setAttribute('value', data.color);
    });
}
setColor()

changeColor.onclick = function (element) {
    chrome.tabs.getSelected(null, function (tab) { // 先获取当前页面的tabID
        chrome.tabs.sendMessage(tab.id, {
            greeting: "hello"
        }, function (response) {
            //element.value(response);
            console.log(response); // 向content-script.js发送请求信息
        });
    });
};